package com.chinasi.web.action;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.chinasi.model.ProductInfo;
import com.chinasi.model.ProjectInfo;
import com.chinasi.service.ProductInfoService;
import com.chinasi.web.action.common.URLConstants;

/** 前沿科技 */
@Controller
@RequestMapping(value = URLConstants.PRODUCT)
public class ProductInfoAction {

	/**
	 * ProductInfoService
	 */
	@Autowired
	private ProductInfoService productInfoService;
	
	/** 前沿科技 */
	@RequestMapping("list")
	public ModelAndView list(){
		Map<String,Object> model = new HashMap<String, Object>();
		model.put("productList", productInfoService.findPageCondition(new ProductInfo(), 1));
		return new ModelAndView("qycp/list", model);
	}
	
	/** 异步加载分页数据 */
	@RequestMapping("loadajax")
	public ModelAndView loadajax(HttpServletRequest request, HttpServletResponse response,ProductInfo searchBean, int curpage){
		Map<String, Object> model = new HashMap<String, Object>();
		model.put("productList", productInfoService.findPageCondition(searchBean,curpage));
		return new ModelAndView("fragment/fragment_consumer_more", model);
	}
}
